//
//  PlateManager.h
//  PlateDemo
//
//  Created by ocrgroup on 2021/3/5.
//  Copyright © 2021 ocrgroup. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "PlateCameraController.h"

NS_ASSUME_NONNULL_BEGIN


@protocol PlateManagerDelegate <NSObject>


/**
 导入/拍照识别回调
 
 @param plateStr 识别结果
 @param srcImage 传入识别的图片
 @param plateImage 车牌切图
 @param errorCode 错误码
 */
- (void)platePhotoRecognizeFinishWithResult:(NSString *)plateStr plateColor:(NSString *)plateColor srcImage:(UIImage *)srcImage plateImage:(UIImage *)plateImage andErrorCode:(int)errorCode;


/**
 视频流识别回调
 
 @param cameraController 自定义相机控制器
 @param plateStr 识别结果
 @param srcImage 完整原图
 @param areaCutImage 区域裁切图
 @param plateImage 车牌切图
 */
- (void)cameraController:(UIViewController *)cameraController videoStreamRecognizePlateFinishWithResult:(NSString *)plateStr plateColor:(NSString *)plateColor srcImage:(UIImage *)srcImage areaCutImage:(UIImage *)areaCutImage andPlateImage:(UIImage *)plateImage;

@end


@interface PlateManager : NSObject


/**
 回调代理
 */
@property (nonatomic, weak) id <PlateManagerDelegate> delegate;

/**
 SDK版本号
 */
@property (nonatomic, copy) NSString * sdkVersion;

/**
 Demo版本号
 */
@property (nonatomic, copy) NSString * codeVersion;


/**
 单例全局访问点
 
 @return 对象实例
 */
+ (instancetype)sharedManager;

/**
 拍照/导入识别
 
 @param plateImage 需要识别的图像
 @param authCode 授权文件名
 */
- (void)recognizePlateWithPhoto:(UIImage *)plateImage andAuthCode:(NSString *)authCode;


/**
 视频流预览识别
 
 @param parentController 当前控制器(self)
 @param usePush 是否使用push弹出控制器 [YES-push NO-modal(模态弹出)]
 @param isHorizontalRecognize 是否横屏识别
 @param authCode 授权文件名
 */
- (void)recognizePlateByVideoStreamWithController:(UIViewController *)parentController usePush:(BOOL)usePush isHorizontalRecognize:(BOOL)isHorizontalRecognize andAuthCode:(NSString *)authCode;


@end

NS_ASSUME_NONNULL_END
